package com.example.springfeature.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//spring内置事件
//ContextRefreshedEvent
//spring启动后执行
@Component
@Slf4j
public class ContextRefreshAction implements ApplicationListener<ContextRefreshedEvent> {
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        log.warn("spring内置事件-- ContextRefreshedEvent Spring Context 初始化或刷新完成事件 finish");
    }
}
